package com.woniuxy.thread;

/**
 * 单例模式（懒汉式）
 *
 * @author 老谭 (<a href="http://www.woniuxy.com">蜗牛学苑</a>)
 *
 */
public class Singleton1 {
	private Singleton1() {

	}

	private volatile static Singleton1 singleton1;

	public synchronized static Singleton1 getInstance() {
		if (singleton1 == null) {
			singleton1 = new Singleton1();
		}
		return singleton1;
	}

}
